#ifndef symbolTable_compil_h
#define symbolTable_compil_h
#include <map>
#include <vector>
#include <string>

#include "TypeBase.hpp"
#include "Symbol.hpp"

typedef	std::map<int, Symbol*> MapSym;

class SymbolTable {
	private:
		std::string name;
		MapSym *symbols;
		SymbolTable *parentTable;
		SymbolTable *callingContext;
		std::map<int,TypeTemp*>*  tempTypes;

	public:
		SymbolTable() ;
		SymbolTable(SymbolTable * parentTable, SymbolTable *callingContext) ;
		~SymbolTable();

		//bool isRecord();
		void setName(std::string name);
		std::string& getName();
		void setParent(SymbolTable * parentTable);
		SymbolTable * getParent() ;
		SymbolTable * getCallingCont() ;

		Symbol * add(int id, Symbol * sym) ;
		void del(int id) ;
		void substitute(int id, Symbol * sym);
		Symbol * getById(int id) ;
		Symbol * getByIdInside(int id) ;
		bool substAllTemp() ;

		SymbolTable * clone();

		TypeTemp * nextTempType(int idIdent);
		bool resTempTypes() ;


		MapSym *  getMap();
		void append(SymbolTable * symbTab) ;


		void showList();
		void show();
};

#endif
